Repository navigation
Read qualified paths in Clippy’s struct lints - #83
Open
charliermarsh wants to merge 1 commit into
Open
charliermarsh wants to merge 1 commit into
charliermarsh wants to merge 1 commit into
Conversation
This was referenced Nov 10, 2026
charliermarsh
force-pushed
the
charlie/struct-qpath-clippy
branch
3 times, most recently
from
November 10, 2026 13:02
e0c9f7e to
dc483e8
Compare
charliermarsh
added a commit
to astral-experiments/ohm
that referenced
this pull request
Nov 10, 2026
## Summary Ohm 1.99.0-31 lets optimized Rust libraries reuse a checked LLVM object before optimization. LLVM can also reuse an object after bounded source edits when every observed line has an unambiguous destination. These paths target incremental O1 builds on x86-64 Linux. [LLVM stack](astral-experiments/ohm-llvm#22) · [Rust compiler change](astral-experiments/ohm-rust#397) Rustc preserves caller locations across worktrees, indexes consecutive procedural-macro spans directly, and retains the joined span of type-relative struct paths. Clippy uses those paths when checking patterns and expressions. [Rust span changes](astral-experiments/ohm-rust#400) · [Clippy companion](astral-experiments/ohm-rust-clippy#83) Cargo documents libraries with names up to 242 bytes and retains active shared builds whose compiler or driver path contains non-UTF-8 bytes. Its checked-in lockfile also matches dependency resolution in a read-only checkout. [Cargo stack](astral-experiments/ohm-cargo#530)
charliermarsh
added a commit
to astral-experiments/ohm
that referenced
this pull request
Nov 10, 2026
## Summary The release smoke test runs Clippy on a small crate, but its code never asks a lint to resolve a struct pattern. We now match a unit variant with braces and expect Clippy’s `unneeded_struct_pattern` lint. If the packaged driver stops recognizing that pattern, `-D warnings` fails the smoke test on the unfulfilled expectation. [Clippy change](astral-experiments/ohm-rust-clippy#83)
charliermarsh
force-pushed
the
charlie/struct-qpath-clippy
branch
from
November 17, 2026 05:22
dc483e8 to
2a6564f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Clippy matches qualified paths in struct expressions and patterns when it checks
use_self, destructuring, range syntax, and other lints. Rustc now keeps the joined span alongside the path, so a match directly against the old HIR field no longer compiles.We borrow the underlying path when a lint resolves a struct expression or pattern. The
#[clippy::author]utility binds that same path when it generates lint code. Both forms also compile against stock rustc’s HIR. Compiler changeThe signed −30 and combined −31 drivers emitted the same lint and suggestion for
None {}. Their#[clippy::author]output also matched byte for byte for a struct expression and a struct pattern. Packaged SDK replay